home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_libgtop.idb / usr / freeware / include / glibtop / proclist.h.z / proclist.h
Encoding:
C/C++ Source or Header  |  1999-07-16  |  2.9 KB  |  105 lines

  1. /* $Id: proclist.h,v 1.17 1999/02/23 11:43:05 martin Exp $ */
  2.  
  3. /* Copyright (C) 1998-99 Martin Baulig
  4.    This file is part of LibGTop 1.0.
  5.  
  6.    Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
  7.  
  8.    LibGTop is free software; you can redistribute it and/or modify it
  9.    under the terms of the GNU General Public License as published by
  10.    the Free Software Foundation; either version 2 of the License,
  11.    or (at your option) any later version.
  12.  
  13.    LibGTop is distributed in the hope that it will be useful, but WITHOUT
  14.    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16.    for more details.
  17.  
  18.    You should have received a copy of the GNU General Public License
  19.    along with LibGTop; see the file COPYING. If not, write to the
  20.    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21.    Boston, MA 02111-1307, USA.
  22. */
  23.  
  24. #ifndef __GLIBTOP_PROCLIST_H__
  25. #define __GLIBTOP_PROCLIST_H__
  26.  
  27. #include <glibtop.h>
  28. #include <glibtop/global.h>
  29.  
  30. BEGIN_LIBGTOP_DECLS
  31.  
  32. #define GLIBTOP_PROCLIST_NUMBER    0
  33. #define GLIBTOP_PROCLIST_TOTAL    1
  34. #define GLIBTOP_PROCLIST_SIZE    2
  35.  
  36. #define GLIBTOP_MAX_PROCLIST    3
  37.  
  38. /* You can use the folowing constants as the `which' member of
  39.  * glibtop_get_proclist () to specify which processes to fetch. */
  40.  
  41. #define GLIBTOP_KERN_PROC_ALL        0    /* all processes */
  42. #define GLIBTOP_KERN_PROC_PID        1
  43. #define GLIBTOP_KERN_PROC_PGRP        2
  44. #define GLIBTOP_KERN_PROC_SESSION    3
  45. #define GLIBTOP_KERN_PROC_TTY        4
  46. #define GLIBTOP_KERN_PROC_UID        5
  47. #define GLIBTOP_KERN_PROC_RUID        6
  48.  
  49. #define GLIBTOP_KERN_PROC_MASK        15
  50.  
  51. #define GLIBTOP_EXCLUDE_IDLE        0x1000
  52. #define GLIBTOP_EXCLUDE_SYSTEM        0x2000
  53. #define GLIBTOP_EXCLUDE_NOTTY        0x4000
  54.  
  55. typedef struct _glibtop_proclist    glibtop_proclist;
  56.  
  57. struct _glibtop_proclist
  58. {
  59.     u_int64_t    flags,
  60.         number,            /* GLIBTOP_PROCLIST_NUMBER    */
  61.         total,            /* GLIBTOP_PROCLIST_TOTAL    */
  62.         size;            /* GLIBTOP_PROCLIST_SIZE    */
  63. };
  64.  
  65. #define glibtop_get_proclist(proclist,which,arg) glibtop_get_proclist_l(glibtop_global_server, proclist, which, arg)
  66.  
  67. #if GLIBTOP_SUID_PROCLIST
  68. #define glibtop_get_proclist_r        glibtop_get_proclist_p
  69. #else
  70. #define glibtop_get_proclist_r        glibtop_get_proclist_s
  71. #endif
  72.  
  73. unsigned *
  74. glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf,
  75.             int64_t which, int64_t arg);
  76.  
  77. #if GLIBTOP_SUID_PROCLIST
  78. void glibtop_init_proclist_p (glibtop *server);
  79.  
  80. unsigned *
  81. glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
  82.             int64_t which, int64_t arg);
  83. #else
  84. void glibtop_init_proclist_s (glibtop *server);
  85.  
  86. unsigned *
  87. glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
  88.             int64_t which, int64_t arg);
  89. #endif
  90.  
  91. #ifdef GLIBTOP_NAMES
  92.  
  93. /* You need to link with -lgtop_names to get this stuff here. */
  94.  
  95. extern const char *glibtop_names_proclist [];
  96. extern const unsigned glibtop_types_proclist [];
  97. extern const char *glibtop_labels_proclist [];
  98. extern const char *glibtop_descriptions_proclist [];
  99.  
  100. #endif
  101.  
  102. END_LIBGTOP_DECLS
  103.  
  104. #endif
  105.